import request from '@/router/axios'

// 获取故障类别树
export function fetchTree(query) {
    return request({
        url: '/ems/emsknoresctg/tree',
        method: 'get',
        params: query
    })
}

// 获取设备类别树
export function fetchDevicecategoryTree(query) {
    return request({
        url: '/ems/emsdevicecategory/tree',
        method: 'get',
        params: query
    })
}

// 获取设备列表
export function emsdeviceaccountPage(query) {
    return request({
        url: '/ems/emsdeviceaccount/page',
        method: 'get',
        params: query
    })
}

// 获取故障库列表
export function fetchList(query) {
  return request({
    url: '/ems/emsfaultlibrary/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/ems/emsfaultlibrary',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/ems/emsfaultlibrary/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/ems/emsfaultlibrary/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/ems/emsfaultlibrary',
    method: 'put',
    data: obj
  })
}
